﻿namespace DemoWebapi01.Entities
{
    public class User : BaseEntity
    {
        /// <summary>
        /// 用户名
        /// </summary>
        public string? UserName { get; set; }
        public string? Password { get; set; }
        public string? Email { get; set; }
        /// <summary>
        /// 昵称
        /// </summary>
        public string? NickName { get; set; }
        public string? PhoneNumber { get; set; }
        public string? Address { get; set; }
        /// <summary>
        /// 头像 Avatar in byte array
        /// </summary>
        public byte[]? Avatar { get; set; }
        public List<Role> Roles { get; } = [];
        public DateTime CreateTime { get; set; }
        public bool IsEmailVerified { get; set; } = false;
        public void AddRole(Role role)
        {
            Roles.Add(role);
        }

    }
}
